#!/usr/bin/perl

##############################################################
#
# This script is used to stop the peridic monitoring of the i3
# servers at the various planetlab nodes.
# All it does is to kill the cron daemon and delete the i3_server_check.pl
# script.  The crontab file is NOT cleaned (TODO clean the crontab file).
#
#Usage: stop_i3_server_monitors.pl
#		-h <host_file, i.e. list of planetlab nodes>
#
##############################################################

use strict 'vars';
package main;

use Getopt::Std;

use vars qw($opt_h);

require "read_deployment.pl";
my %deployment_details = &get_deployment_details;

my $deployment_dir = $deployment_details {"deployment_dir"};
print "Deployment dir = $deployment_dir\n";

#get command line options
getopts('h:');
if ($opt_h eq "" ) {
    die "Usage: stop_i3_server_monitors.pl -h <host_file>\n";
}

system("./pl_exec.pl -h $opt_h -f cmdlist_stop_i3_server_monitor.txt -p $deployment_dir");
#sleep 120;
